package cn.com.huzo.model.entities.manufacture;

import huzofw.model.entities.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import huzofw.model.entities.IAggregateRoot;
import java.io.Serializable;
import java.sql.Timestamp;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 加工承揽合同-合同明细子表记录实体类
 * <p>
 * @author 吴旭
 */
public class CommissionProcessingContractLinesEntity extends BaseEntity implements Serializable, IAggregateRoot {

    private static final long serialVersionUID = -4349892919138126393L;
    private String LinesId;
    private Long HeaderId;
    private String ContractNo;                  // 合同号
    private Long MoId;                          // 生产指示书标识
    private Long ProductId;
    private String StyleNo;
    private String ProductName;
    private String UomName;
    private Double ContractQuantity;            // 加工数量
    private Double ProcessingFee;               // 加工费
    private Double Amount;                      // 金额
    private Timestamp ManufactureDate;          // 出厂日期
    private Timestamp MaterialReceiptedDate;    // 配送料日期
    private Timestamp MaterialFinishedDate;     // 组料完成日期

    public String getLinesId() {
        return LinesId;
    }

    public void setLinesId(String LinesId) {
        this.LinesId = LinesId;
    }

    public Long getHeaderId() {
        return HeaderId;
    }

    public void setHeaderId(Long HeaderId) {
        this.HeaderId = HeaderId;
    }

    public String getContractNo() {
        return ContractNo;
    }

    public void setContractNo(String ContractNo) {
        this.ContractNo = ContractNo;
    }

    public Long getMoId() {
        return MoId;
    }

    public void setMoId(Long MoId) {
        this.MoId = MoId;
    }

    public Long getProductId() {
        return ProductId;
    }

    public void setProductId(Long ProductId) {
        this.ProductId = ProductId;
    }

    public String getStyleNo() {
        return StyleNo;
    }

    public void setStyleNo(String StyleNo) {
        this.StyleNo = StyleNo;
    }

    public String getProductName() {
        return ProductName;
    }

    public void setProductName(String ProductName) {
        this.ProductName = ProductName;
    }

    public String getUomName() {
        return UomName;
    }

    public void setUomName(String UomName) {
        this.UomName = UomName;
    }

    public Double getContractQuantity() {
        return ContractQuantity;
    }

    public void setContractQuantity(Double ContractQuantity) {
        this.ContractQuantity = ContractQuantity;
    }

    public Double getProcessingFee() {
        return ProcessingFee;
    }

    public void setProcessingFee(Double ProcessingFee) {
        this.ProcessingFee = ProcessingFee;
    }

    public Double getAmount() {
        return Amount;
    }

    public void setAmount(Double Amount) {
        this.Amount = Amount;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Timestamp getManufactureDate() {
        return ManufactureDate;
    }

    public void setManufactureDate(Timestamp ManufactureDate) {
        this.ManufactureDate = ManufactureDate;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Timestamp getMaterialReceiptedDate() {
        return MaterialReceiptedDate;
    }

    public void setMaterialReceiptedDate(Timestamp MaterialReceiptedDate) {
        this.MaterialReceiptedDate = MaterialReceiptedDate;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Timestamp getMaterialFinishedDate() {
        return MaterialFinishedDate;
    }

    public void setMaterialFinishedDate(Timestamp MaterialFinishedDate) {
        this.MaterialFinishedDate = MaterialFinishedDate;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof CommissionProcessingContractLinesEntity)) {
            return false;
        }

        final CommissionProcessingContractLinesEntity that = (CommissionProcessingContractLinesEntity) o;

        return new EqualsBuilder()
                .append(this.getLinesId(), that.getLinesId())
                .isEquals();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int hashCode() {
        int result = 17;
        result = 31 * result + this.getLinesId().hashCode();

        return result;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
